/**
 * @author nttdocomo
 */
(function() {
	$LAB.script("/js/sea.js", "/js/jquery.js", "/js/underscore.js").wait().script("/js/backbone.js", "/js/aries.js").wait(function() {
		seajs.config({
			alias : {
				'jquery' : 'jquery',
				'backbone' : 'backbone',
				'underscore' : 'underscore',
				'aries' : 'aries'
			},
			base : 'http://ui.example.com/js/',
			charset : 'utf-8'
		});
		var $body = $("#main");
		seajs.use("../../js/form/field/file.js", function() {
			new aries.form.field.File({
				renderTo : $body,
				buttonOnly : true,
				hideLabel : true,
				listeners : {
					'change' : function(fb, v) {
						var el = Ext.get('fi-button-msg');
						el.update('<b>Selected:</b> ' + v);
						if (!el.isVisible()) {
							el.slideIn('t', {
								duration : 200,
								easing : 'easeIn',
								listeners : {
									afteranimate : function() {
										el.highlight();
										el.setWidth(null);
									}
								}
							});
						} else {
							el.highlight();
						}
					}
				}
			});
		})
	})
})()